Skip to content

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

oli-obk and others added 30 commits February 20, 2025 13:39
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
It was added in rust-lang#129523 to enable building on stable when there were
`cfg(bootstrap)` occurrences in the crate. But those are gone now, so
the section can be removed.
`llvm_enzyme` is now in the extra `check-cfg` list in bootstrap, so it
doesn't need to be handled explicitly here.
By naming them in `[workspace.lints.rust]` in the top-level
`Cargo.toml`, and then making all `compiler/` crates inherit them with
`[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`,
because they're a bit different.)

The advantages of this over the current approach:
- It uses a standard Cargo feature, rather than special handling in
  bootstrap. So, easier to understand, and less likely to get
  accidentally broken in the future.
- It works for proc macro crates.

It's a shame it doesn't work for rustc-specific lints, as the comments
explain.
And fix the new errors in the handful of crates that didn't have a
`#![warn(unreachable_pub)]`.
(Except for `rustc_codegen_cranelift`.)

It's no longer necessary now that `unreachable_pub` is in the workspace
lints.
...either as:
- methods on LayoutCalculator, for faillible operations;
- constructors on LayoutData, for infaillible ones.
Also properly attaches spans on layouts of non-promoted coroutine
locals, which slightly improves the error messages for some coroutine tests.
the errors should not be there, this is a bug/missing feature.
this prevents us from trying unsizing coercion in cases like
`*const W<dyn T>` -> `*const dyn T`, where it would later cause a
compilation error since `W<dyn T>: Sized` and `W<dyn T>: T` do not hold.
yay, I fixed the bug/missing feature :')
This feature was approved for stabilization in
rust-lang#129041 (comment)
so this change stabilizes it.
…r=compiler-errors

Allow `*const W<dyn A> -> *const dyn A` ptr cast

Followup of rust-lang#120248 (comment).

This PR allows casting pointers from something wrapping a trait object, to the trait object, i.e. `*const W<dyn A> -> *const dyn A` where `W` is `struct W<T: ?Sized>(T);`.

r? compiler-errors

Fixes rust-lang#128625
Turn order dependent trait objects future incompat warning into a hard error

fixes rust-lang#56484

r? ``@ghost``

will FCP when we have a crater result
…-slice, r=dtolnay

Stabilize `const_vec_string_slice`

This feature was approved for stabilization in
rust-lang#129041 (comment) so this change stabilizes it.
tidy: add triagebot checks

Validates triagebot.toml to have existing paths:

`[mentions."*"]` sections, i.e.
```toml
[mentions."compiler/rustc_const_eval/src/"]
```
or
```toml
[assign.owners]
"/.github/workflows" = ["infra-ci"]
```
or

```toml
trigger_files = [
 "src/librustdoc/html/static/js/search.js",
 "tests/rustdoc-js",
 "tests/rustdoc-js-std",
 ]
```
Looked at rust-lang#137876 and implemented check.
…mpiler, r=compiler-errors

compiler: Use `size_of` from the prelude instead of imported

Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler.

These functions were added to all preludes in Rust 1.80.

r? ``@compiler-errors``
…youxu

Use workspace lints for crates in `compiler/`

This is nicer and hopefully less error prone than specifying lints via bootstrap.

r? ``@jieyouxu``
…r=workingjubilee

Move more layouting logic to `rustc_abi`

Move all `LayoutData`-constructing code to `rustc_abi`:
- Infaillible operations get a new `LayoutData` constructor method;
- Faillible ones get a new method on `LayoutCalculator`.
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Mar 9, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Mar 9, 2025

📌 Commit f7ef35b has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2025
@bors
Copy link
Collaborator

bors commented Mar 9, 2025

⌛ Testing commit f7ef35b with merge ed897d5...

@bors
Copy link
Collaborator

bors commented Mar 9, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing ed897d5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 9, 2025
@bors bors merged commit ed897d5 into rust-lang:master Mar 9, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 9, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

gh pr comment ${HEAD_PR} -F output.log
shell: /usr/bin/bash -e {0}
##[endgroup]
fatal: ambiguous argument 'HEAD^1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
##[error]Process completed with exit code 128.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#136127 Allow *const W<dyn A> -> *const dyn A ptr cast 63be0e2a5434d0c41423cc7e7fcce90977ab7ba9 (link)
#136968 Turn order dependent trait objects future incompat warning … 702badc3cfbb4c300b44187a810dc86d4be27584 (link)
#137319 Stabilize const_vec_string_slice b3f792f6a4b631e887dbde431197ff5f433c5a4f (link)
#137885 tidy: add triagebot checks be9cf33481942bb054df9166e4f51b0f28cc8eb0 (link)
#138040 compiler: Use size_of from the prelude instead of imported ffc504a8dd9cabc66bb1421c86e73affc4e1a07b (link)
#138084 Use workspace lints for crates in compiler/ 8163c08c935b3175ca8f7f763b608268e0a9dd85 (link)
#138158 Move more layouting logic to rustc_abi ffbe058ce34fba62f878ef42cad34656bdf03711 (link)
#138160 depend more on attr_data_structures and move find_attr! the… 0042afe81bb8c70454f6445c9ce3903333c46cf7 (link)
#138192 crashes: couple more tests a22ca983cc2cd9cd7f4130b9f087c77c9847c159 (link)
#138216 bootstrap: Fix stack printing when a step cycle is detected 1493ce6c90dfe4c1924af15b4cff7c42dd75a199 (link)
#138232 Reduce verbosity of GCC build log 28551e10c34b7ec9da84216b72297723e38f2e7e (link)
#138242 Revert "Don't test new error messages with the stage 0 comp… af83893f992c45f3709ff1356fc0a331a94b1ac9 (link)

previous master: 4f52199194

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ed897d5): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.7% [0.1%, 1.6%] 105
Regressions ❌
(secondary)
3.5% [0.1%, 12.5%] 94
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.1%, 1.6%] 105

Max RSS (memory usage)

Results (primary 1.9%, secondary 3.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.9% [0.5%, 4.2%] 17
Regressions ❌
(secondary)
3.0% [0.7%, 6.1%] 17
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [0.5%, 4.2%] 17

Cycles

Results (primary 1.3%, secondary 5.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.3% [0.8%, 1.9%] 30
Regressions ❌
(secondary)
5.0% [1.4%, 9.5%] 40
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [0.8%, 1.9%] 30

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 765.417s -> 768.783s (0.44%)
Artifact size: 362.05 MiB -> 361.99 MiB (-0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Mar 9, 2025
@Kobzol
Copy link
Member

Kobzol commented Mar 10, 2025

The regression was caused by #136127, a fix is in progress in #138292.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.